<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace Common\Library\COM;

/**
 * Description of GoodsDo
 *
 * @author gangguo
 */
class GoodsDo {
    //put your code here
    
    static public function getGoods(){
        return D('Common/Goods');
    }
    
    
    static public function store($ids,$step = -1){
        if(empty($ids))            return FALSE;
        if(is_array($ids)){
            $Goods = self::getGoods();
            foreach ($ids as $k=>$v){
                if(is_numeric($v)){
                    $Goods->CheangeStore($v,$step);
                }
                if($v['goods_id'] > 0){
                    $Goods->CheangeStore($v['goods_id'],$step);
                }
            }
            return TRUE;
        }
        if($ids > 0){
            return self::getGoods()->CheangeStore($ids,$step);
        }
        return FALSE;
    }
}
